/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author aluno
 */
public class Verificadores {
public static boolean verificaTelefone(String telefoneNovo){
   String telregex = "\\([0-9][0-9]\\)[0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]";
   Pattern p = Pattern.compile(telregex);
   Matcher m = p.matcher(telefoneNovo);
   boolean b = m.matches();
   return b;
}
public static boolean verificaData(String dataNova){
   String dateregex = "[0-3][0-9]\\/[0-1][0-9]\\/[1-2][0-9][0-9][0-9]";
   Pattern p = Pattern.compile(dateregex);
   Matcher m = p.matcher(dataNova);
   boolean b = m.matches();
   return b;
}
public static boolean verificaRg(String novoRg){
   String rgregex = "[0-9][0-9]\\.[0-9][0-9][0-9]\\.[0-9][0-9][0-9]\\-.";
   Pattern p = Pattern.compile(rgregex);
   Matcher m = p.matcher(novoRg);
   boolean b = m.matches();
   return b;
} 
}
